<?php
class Slide extends CI_Model
{
	function __construct()
	{
		parent::__construct();
		
	}
	function get_all()
	{
		$this->db->select('*');
		$this->db->order_by('id','desc');
		$query = $this->db->get_where('slideimage');
		return $query->result_array();
	}
	function new_img($data)
	{
		$this->db->insert('slideimage',$data);
	}
	function delete($id)
	{
		$this->db->select('*');
		$query = $this->db->get_where('slideimage',array('id'	=> $id));
		$buf=$query->row_array();
		
		$this->db->delete('slideimage',array('id'	=> $id));
		return $buf['url'];;
	}
	function update($data)
	{
		$this->db->update('slideimage',$data,array('id'	=> $data['id']));
	}
}